/*
 * Cube Sum Problem
 *
 * Author: Yue ZHAO
 *
 * language: C++
 */

#include <iostream>
#include <cstdlib>

using namespace std;

class CubeSum {
public:
  int count(long long N) {
    if (N > 100000000 || N < 0)
      return -1;

    return aux(N, 0, 4);
  }

  int aux(long long x, int i, int n) {
    if (n==0) {
      if (x == 0) 
        return 1;
      else
        return 0;
    }

    int ret = 0;
    for (; i<=1000; i++) {
      long long cub = i*i*i;
      if (cub > x) break;
      ret += aux(x-cub, i, n-1);
    }

    return ret;
  }

};


int main(int argc, char **argv) {
  CubeSum cs;

  long long N = 0;
  if (argc > 1)
    N = atoi(argv[1]);
  else {
    cout << "Enter a number: " << endl;
    cin >> N;
  }
  cout << cs.count(N) << endl;
  system("pause");
  return 0;
}
